CodeIgniter - numbers in sql query are masked with ``

Posted by Checkson on Stack Overflow See other posts from Stack Overflow or by Checkson
Published on 2010-08-24T08:15:28Z Indexed on 2010/12/25 23:54 UTC
Read the original article Hit count: 132

Filed under:
|
|

Hello,

i'm using CodeIgniter for developing a community board. As I'm using nested sets to get a nested forum hierarchy, I have to run a lot of queries such as:

SELECT `id` FROM `forums` WHERE 1 BETWEEN `lft` AND `rgt`

My problem: CodeIgniter is replacing the "1" by "`1`" because the "1" is recognized as a column name. Of course, the query does not work any more.

Is there a way to get it working?

thx in advance

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql